package com.example.demo.service.impl;

import com.example.demo.service.IMessageProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.jms.Queue;

/**
 * 发送消息接口实现
 * Created by Hy on 2019/3/13.
 */
@Service
public class MessageProducerServiceImpl implements IMessageProducerService {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;
    @Autowired
    private Queue queue;
    @Override
    public void sendMsg(String msg) {
        jmsMessagingTemplate.convertAndSend(this.queue,msg);
    }
}
